<%--    
创建时间：2017年10月16日上午10:38:52   
创 建 人：JobsZhang  
相关说明：   
JDK1.6.0_21 tomcat6.0.29 servlet2.5    
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>upload</title>
<link rel="stylesheet" type="text/css" href="css/webuploader.css" />
<!-- <link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css" /> -->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js" ></script>
<script type="text/javascript" src="js/webuploader.min.js" ></script>
<script type="text/javascript" src="js/myupload.js" ></script>
<!-- <script type="text/javascript" src="bootstrap/js/bootstrap.js" ></script> -->
<style type="text/css">

</style>
<script type="text/javascript">
	$(function(){
    var opt1 = {
    		server:"${pageContext.request.contextPath}/UploadServlet",
			swf:"${pageContext.request.contextPath}/js/webuploader/js/Uploader.swf",
			chunked:false,
			fileSizeLimit:5*1024*1024,
		    fileSingleSizeLimit:5*1024*1024,
	};
/* 	$("#imgUplod").upload(opt1,function(data){
		console.log(data);
	}); */ 
	
	var opt={
			auto:false,
			swf:"${pageContext.request.contextPath}/js/webuploader/js/Uploader.swf",
			chunked:true,
			chunkSize:5*1024*1024,
			server:"${pageContext.request.contextPath}/TransmissionServlet",
			accept: {
	                title: 'mediaFile',
	                extensions: 'gif,jpg,jpeg,bmp,png,3gp,mp4,rmvb,mov,avi,m4v,mp3',
	                mimeTypes: 'image/*,video/*,audio/*,application/*'
	             },
	       fileNumLimit:1, 
	       fileSizeLimit:9995*1024*1024,
	       fileSingleSizeLimit:9995*1024*1024,
	       threads:5,
           //在上传当前文件时，准备好下一个文件
           prepareNextFile:true,
           fileCheckUrl:'${pageContext.request.contextPath}/UploadMixServlet?action=fileCheck',//检测文件是否存在url
		   checkChunkUrl:'${pageContext.request.contextPath}/UploadMixServlet?action=checkChunk',//检测分片url
		   mergeChunksUrl:'${pageContext.request.contextPath}/UploadMixServlet?action=mergeChunks' //合并文件请求地址
	};
    $("#uploadFile").upload(opt,function(data){
    	console.log(data);
    });
	});
</script>
</head>
<body>
<p>不开启分片上传</p>
<div id="imgUplod"></div>
<hr>
<p>开启分片上传</p>
<div id="uploadFile"></div>

</body>
</html>